package org.clxmm.security.springmvc.init;

import org.clxmm.security.springmvc.config.ApplicationConfig;
import org.clxmm.security.springmvc.config.WebConfig;
import org.clxmm.security.springmvc.config.WebSecurityConfig;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * @author clxmm
 * @Description
 * @create 2021-06-06 5:17 下午
 */
public class SpringApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {


    // spring 容器 加载 applicationContext
    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[]{ApplicationConfig.class, WebSecurityConfig.class};
    }

    // servletContext   加载springmvc
    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{WebConfig.class};
    }

    // url-mapping
    @Override
    protected String[] getServletMappings() {
        return new String[]{"/"};
    }
}
